<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/translator.tld" prefix="trans" %><head>
<trans:initPage module="proplists" />
<link rel="stylesheet" href="<html:rewrite page="/alf.css" />" type="text/css">
<bean:define id="list" name="proplist_selectorform" property="list" type="ro.gateway.aida.admin.PropertyList"/>
<bean:define id="selected" name="proplist_selectorform" property="selected" type="java.util.ArrayList"/>
<html:html>
<head>
      <script language="javascript">
            function make_layer_visible(layer) {
                  layer = document.getElementById(layer);
                  if (!layer) return;

                  if (layer.style) {
                        layer.style['visibility'] = 'visible';
                  } else {
                        layer.visibility = 'visible';
                  }
            }
		function savelist(forma) {
			if (!window.opener || !window.opener.after_prop_sel) {
				alert('Component not configured properly!');return;
			}
               window.opener.after_prop_sel(forma.selectedIds.value);
			window.close();
		}
      </script>
</head>
<body bgcolor="#FFFFFF" text="#000000">

<div id="loading" style="position: relative;visibility: hidden;height:50px;width:50%;left: 25%;top: 5%;text-align: center;vertical-align: middle;border: 1px dotted;background-color: #f2f2f2;z-index:4;" class="text_searchbold">
  <br>
  Loading...<br>
  Please wait<br>
</div>
      <html:form action="/admin/selproplist">
      <html:hidden property="event" value="" />
	 <input type="hidden" name="selectedIds" value="<bean:write name="proplist_selectorform" property="selectedIds"/>"/>
      <table width="90%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#3399CC" class=text_searchbold>
            <tr bgcolor="#3399CC"><td class="textalb">
                  <trans:showPageMessage label="selectortitle" /></td>
            </tr>

            <logic:present name="search_failed">
            <tr bgcolor="#FFFFFF">
                  <td class="textalb" style="color:red;">
                 <trans:showPageMessage label="findsec.srcfailedtryagain" />
                  </td>
            </tr>
            </logic:present>

            <tr bgcolor="#FFFFFF">
                  <td>
			   <select name="idx">
			   	<logic:iterate indexId="i" id="item" name="list" property="items" >
				   <option value="<%=i%>"><bean:write name="item"/></option>
				</logic:iterate>
			   </select>
                  <input type="button"
                        class="butonsave"
                        onclick="this.form.event.value='add';this.form.submit();"
                        value="<trans:showPageMessage label="selector.add" hide_link="true" />" />
                  </td>
            </tr>

		  <% if (selected != null && selected.size() > 0) { %>
            <tr bgcolor="#f9f9f9">
                  <td bgcolor="#f9f9f9">
				<logic:iterate id="item" name="selected" indexId="i" type="ro.gateway.aida.admin.PropertyListItem">
                    <div>
				<input type="checkbox" name="idxs" value="<%=i%>"/>
				<bean:write name="item"/>
				</div>
				</logic:iterate>
                  </td>
            </tr>
            <tr bgcolor="#f9f9f9">
                  <td bgcolor="#f9f9f9">
                  <input type="button"
                        class="butonsave"
                        onclick="this.form.event.value='delsel';this.form.submit();"
                        value="<trans:showPageMessage label="selector.delselected" hide_link="true" />" />
                  </td>
            </tr>
		  <% } %>


            <tr bgcolor="#f9f9f9">
                  <td align="center" bgcolor="#f9f9f9">
                  <input type="button"
                        class="butonsave"
                        onclick="savelist(this.form);"
                        value="<trans:showPageMessage label="selector.saveselected" hide_link="true" />" />
                  </td>
            </tr>
      </table><trans:showPageMessage label="translator.showhiddentags"/>
      </html:form>
</body>
</html:html>
